<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环嵌套</title>
    <script>
        /*
            循环嵌套.
        */
        for(var i=1;i<=10;i++){// 10次

            for(var j=1;j<=10;j++){  //10次
                document.write(" * &nbsp;&nbsp;&nbsp;");
            }
            // \n \t \b
            document.write("<br/>");//每隔十个 *  换行一下.
        }
        /*
            9 x 9 乘法表
        */
        for(var i=1;i<=9;i++){
            for(var j=1;j<=i;j++){
                var re=i*j;
                document.write(i+"x"+j+"="+re+"&nbsp;&nbsp;&nbsp;");
            }
            document.write("<br/>");
        }
        document.write("<br/>");
        for(var i=1;i<=9;i++){
            for(var j=i;j<=9;j++){
                var re=i*j;
                document.write(i+"x"+j+"="+re+"&nbsp;&nbsp;&nbsp;");
            }
            document.write("<br/>");
        }
    </script>
</head>
<body>
</body>
</html>